// 基础样式
.error-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f1221;
  z-index: 1000;
  transition: all 0.5s ease;
}

// 加载动画
.error-page:not(.loaded) .error-container {
  opacity: 0;
  transform: translateY(20px);
}

.error-page.loaded .error-container {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

// 背景效果
.error-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 50px 160px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 130px 80px, #fff, rgba(0, 0, 0, 0)),
  radial-gradient(2px 2px at 160px 120px, #fff, rgba(0, 0, 0, 0));
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: stars-move 20s linear infinite;
}

@keyframes stars-move {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 200px 200px;
  }
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a1e35 0%, #0f1221 100%);
}

// 错误容器
.error-container {
  position: relative;
  z-index: 2;
  max-width: 600px;
  width: 100%;
  padding: 40px;
  text-align: center;
}

// 错误代码
.error-code {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  height: 180px;
}

.digit {
  font-size: 180px;
  font-weight: 900;
  margin: 0 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.digit.zero {
  animation-delay: 0.5s;
}

.digit:nth-child(3) {
  animation-delay: 1s;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}

// 错误信息
.error-message {
  margin-bottom: 30px;
}

.error-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.error-description {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

// 搜索框
.error-search {
  margin-bottom: 30px;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.search-input {
  border-radius: 8px 0 0 8px !important;
  height: 42px !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

// 操作按钮
.error-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

.home-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0 24px !important;
  height: 42px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.home-button:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4) !important;
}

.reload-button {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 0 24px !important;
  height: 42px !important;
  font-size: 16px !important;
  transition: all 0.3s ease !important;
}

.reload-button:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-3px) !important;
}

// 装饰元素
.error-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.decoration {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0.1;
  filter: blur(50px);
  animation: pulse 8s ease-in-out infinite;
}

.decoration-1 {
  width: 300px;
  height: 300px;
  top: -150px;
  left: -150px;
  animation-delay: 0s;
}

.decoration-2 {
  width: 400px;
  height: 400px;
  bottom: -200px;
  right: -200px;
  animation-delay: 2s;
}

.decoration-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  right: 10%;
  animation-delay: 1s;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.2;
  }
  100% {
    transform: scale(1);
    opacity: 0.1;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .digit {
    font-size: 120px;
  }

  .error-code {
    height: 120px;
  }

  .error-title {
    font-size: 28px;
  }

  .error-description {
    font-size: 16px;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
  }

  .home-button, .reload-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .digit {
    font-size: 80px;
  }

  .error-code {
    height: 80px;
  }

  .error-title {
    font-size: 24px;
  }

  .error-container {
    padding: 20px;
  }
}
